<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org" lang="zh-CN">
<head>
    <meta charset="UTF-8"/>
    <title>登录</title>
    <link href="https://cdn.staticfile.org/twitter-bootstrap/5.3.0/css/bootstrap.min.css" rel="stylesheet"/>
    <link href="/css/auth.css" rel="stylesheet"/>
</head>
<body>
<div class="login-card">
    <h2>用户登录</h2>

    <div th:if="${param.error}" class="alert alert-danger" role="alert">
        用户名或密码错误！
    </div>
    <div th:if="${param.logout}" class="alert alert-success" role="alert">
        已成功注销！
    </div>
    <div th:if="${message}" class="alert alert-success" th:text="${message}" role="alert"></div>

    <form method="post" action="/login" novalidate>
        <div class="mb-4">
            <label for="username" class="form-label">用户名</label>
            <input
                    type="text"
                    id="username"
                    name="username"
                    class="form-control"
                    placeholder="请输入用户名"
                    required
                    autofocus
            />
        </div>

        <div class="mb-5">
            <label for="password" class="form-label">密码</label>
            <input
                    type="password"
                    id="password"
                    name="password"
                    class="form-control"
                    placeholder="请输入密码"
                    required
            />
        </div>

        <button type="submit" class="btn btn-primary">登录</button>
    </form>

    <p class="mt-3">
        没有账号？<a href="/register">去注册</a>
    </p>
</div>
</body>
</html>
